package com.wuyou.sso.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户
 *
 * @author lishangbu
 * @date 2021/1/22
 */
@Data
@TableName(autoResultMap = true)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
//    @ApiModelProperty(value = "用户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 用户名
     */
//    @ApiModelProperty(value = "用户名", required = true)
//    @NotEmpty(message = "用户名不存在")
//    @JsonDeserialize(using = DecSerializable.class)
    private String username;

    /**
     * 密码
     */
//    @ApiModelProperty(value = "密码")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
//    @JsonDeserialize(using = DecSerializable.class)
    private String password;

    /**
     * 创建时间
     */
//    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
//    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 手机号
     */
//    @ApiModelProperty(value = "手机号", required = true)
//    @NotEmpty(message = "手机号不存在")
//    @Pattern(regexp = RegexpValidationConstants.REGEX_MOBILE, message = "手机号不合法")
//    @TableField(typeHandler = AesEncryptHandler.class)
//    @JsonDeserialize(using = DecSerializable.class)
    private String mobile;

    /**
     * 部门ID
     */
//    @ApiModelProperty(value = "用户所属部门id", required = true)
    @JsonSerialize(using = ToStringSerializer.class)
//    @NotNull(message = "用户所属部门不存在")
    private Long deptId;

    /**
     * 手机号
     */
//    @ApiModelProperty("手机号")
//    @TableField(typeHandler = AesEncryptHandler.class)
//    @JsonDeserialize(using = DecSerializable.class)
    private String phoneNumber;
    /**
     * 姓名
     */
//    @ApiModelProperty("姓名")
//    @JsonDeserialize(using = DecSerializable.class)
    private String displayName;
    /**
     * 电话区域
     */
//    @ApiModelProperty("电话区域")
    private String phoneRegion;
    /**
     * 用户UUID
     */
//    @ApiModelProperty("用户UUID")
    private String userUuid;
    /**
     * IDASS用户ID
     */
//    @ApiModelProperty("IDASS-用户ID")
    private String userId;
    /**
     * 邮箱
     */
//    @ApiModelProperty("邮箱")
//    @TableField(typeHandler = AesEncryptHandler.class)
    private String email;

    /**
     * 微信open_id,司机登录使用
     */
//    @ApiModelProperty("微信open_id,司机登录使用")
    private String openId;

//    @ApiModelProperty("用户状态")
    private Integer status;

//    @ApiModelProperty("用户头像")
//    @FileAccessibleUrlRender
    private Long file;
}
